<?php
App::uses('AppModel', 'Model');
/**
 * RegioesAdministrativa Model
 *
 */
class RegiaoAdministrativa extends GeonamesAppModel {

/**
 * Display field
 *
 * @var string
 */
	public $useDbConfig = 'geonames';
	public $displayField = 'name';
	public $useTable = 'geonames_regioes_administrativas';

	public function findStateByGeoCode($code){
		$data = $this->find('first', array('conditions'=>array('geonameId'=>$code, 'language'=>getLanguage())));
		if($data)
			return $data[$this->alias]['name'];
	}

}
